package com.ljy.my_study.java.gc;

import java.time.Duration;
import java.time.Instant;

/**
 * @author lijunying
 * @date 2021/2/20 9:52
 */
public class TLABTestMain {

    /**
     * -XX:+UseTLAB -server -Xcomp -XX:-BackgroundCompilation -XX:-DoEscapeAnalysis
     * @param args
     */
    public static void main(String[] args) {
        Instant start=Instant.now();
        for(int i=0;i<10000000;i++){
            alloc();
        }
        Instant end=Instant.now();
        System.out.println(Duration.between(start,end).toMillis());
    }

    public static void alloc(){
        Student student=new Student();
        student.setName("James");
        student.setAge(27);
    }
}
